<?php
// Grid
//$grid = new jqGridRender(Registry::getInstance() -> get('db'));
//$conn = new PDO('mysql:host='. dblocation .';dbname=' . 'test',DB_USER,DB_PASSWORD);
//$conn->query("SET NAMES utf8");
//$grid = new jqGridRender($conn);
$grid = new jqGridRender();

// Write the SQL Query
//$grid->SelectCommand = 'SELECT * FROM photo';
// set the ouput format to json
/*
$grid->dataType = 'json';
$grid->navigator = true;
*/
/*
$grid->setGridOptions(array(
    "caption"=>"This is custom Caption",
    "rowNum"=>10,
    "sortname"=>"photo_id",
    "hoverrows"=>true,
    "rowList"=>array(10,20,50),
    "url"=>PUBLIC_URL . "/core/login/asd",
));
$grid->setColModel();
*/

// Change some property of the field(s)
/*
$grid->setColProperty("photo_id", array("label"=>"ID", "width"=>60));
$grid->setColProperty("date_added", array(
        "formatter"=>"date",
        "formatoptions"=>array("srcformat"=>"Y-m-d H:i:s","newformat"=>"m/d/Y")
    )
);
*/
/*
$grid->addCol(array(
    "name"=>"actions",
    "formatter"=>"actions",
    "editable"=>false,
    "sortable"=>false,
    "resizable"=>false,
    "fixed"=>true,
    "width"=>60,
    "formatoptions"=>array("keys"=>true)
), "first");
$grid->setColProperty('EmployeeID', array("editable"=>false));
$grid->setColProperty('BirthDate',
    array("formatter"=>"date","formatoptions"=>array("srcformat"=>"Y-m-d H:i:s", "newformat"=>"Y-m-d")));

$grid->setGridOptions(array(
    "rowNum"=>10,
    "rowList"=>array(10,20,300),
    "sortname"=>"EmployeeID"
));
*/

$s = $grid-> renderGrid($tbl_id = '#grid',
                        $pgr_id = '#pager',
                        $auto_script = true,
                        $summary = null,
                        $params = null,
                        $auto_create_tbl = false,
                        $auto_create_pgr = false,
                        $echo_grid = false
                        );


$this->view->s = $s;